package Day4.ZuoYe.Compang;

import java.util.Objects;
////公司有很多员工（用Map存储），员工有姓名，年龄，性别，职务，薪水、工号等属性，
public class Staff {
    private String jobNumber;
    private String name;
    private String sex;
    private int age;
    private String position;
    private double salary;

    public Staff() {
    }

    public Staff(String name, String sex, int age, String position, double salary) {
        this.name = name;
        this.sex = sex;
        this.age = age;
        this.position = position;
        this.salary = salary;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Staff staff = (Staff) o;
        return Objects.equals(jobNumber, staff.jobNumber);
    }

    @Override
    public int hashCode() {
        return Objects.hash(jobNumber);
    }

    @Override
    public String toString() {
        return name +
                "   " + sex +
                "   " + age +
                "   " + position +
                "   " + salary;
    }

    public String getJobNumber() {
        return jobNumber;
    }

    public void setJobNumber(String jobNumber) {
        this.jobNumber = jobNumber;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getPosition() {
        return position;
    }

    public void setPosition(String position) {
        this.position = position;
    }

    public double getSalary() {
        return salary;
    }

    public void setSalary(double salary) {
        this.salary = salary;
    }


}
